<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Removendo aluno</title>
</head>
<body>
<%
int teste=0;
int idaluno = Integer.parseInt(request.getParameter("id"));
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/gic", "root", "");
Statement stm = conn.createStatement();
int res = stm.executeUpdate("delete from aluno where idAluno=" + idaluno);
out.println("<Script language='JavaScript'> ");
if(res>=1){
	out.println("alert('Registro removido com sucesso');");
	out.println("history.go(-1);");
	
} else {
	out.println("alert('Registro removido com sucesso');");
	out.println("history.go(-1);");
	}
out.println("</Script>");

%>
</body>
</html>